package edu.fiu.kdrg.fsm.core;

import java.util.List;
import java.util.ArrayList;

/**
 * @author Chunqiu Zeng
 *
 */
public class Node {
	/**
	 * 
	 */
	private int id = -1;

	/**
	 * 
	 */
	private String name = "";

	/**
	 * 
	 */
	private String value = "";

	/**
	 * 
	 */
	private List<Node> children = new ArrayList<Node>();

	/**
	 * 
	 */
	public Node() {
	}

	/**
	 * @return the id
	 */
	public int getId() {
		return id;
	}

	/**
	 * @param id
	 *            the id to set
	 */
	public void setId(int id) {
		this.id = id;
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name
	 *            the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @return the value
	 */
	public String getValue() {
		return value;
	}

	/**
	 * @param value
	 *            the value to set
	 */
	public void setValue(String value) {
		this.value = value;
	}

	/**
	 * @param index
	 * @return
	 */
	public Node getChildAt(int index) {
		return children.get(index);
	}

	/**
	 * @param node
	 */
	public void addChild(Node node) {
		children.add(node);
	}

	/**
	 * @param index
	 * @param node
	 */
	public void insertChild(int index, Node node) {
		children.add(index, node);
	}

}
